﻿<Window x:Class="CECB.V_EmailReader_Window"
       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
         xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"
        mc:Ignorable="d"
        xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing"
        
        xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
   
        Title="V_EmailReader_Window"  Height="{Binding SystemParameters.PrimaryScreenHeight}" 
    Width="{Binding SystemParameters.PrimaryScreenWidth}" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" WindowState="Maximized" WindowStyle="None">

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="200" />
            <ColumnDefinition Width="300" />
            <ColumnDefinition Width="860" />

        </Grid.ColumnDefinitions>

        <!--<Expander Header="expander1" Name="expander1" Grid.Column="2" Margin="0,0,0,47" Grid.ColumnSpan="2">
            <WebBrowser Height="850" Name="webBrowser1" Width="877" />
        </Expander>-->
        <WrapPanel Grid.Column="0" Orientation="Vertical" Background="#FF554E4E" OpacityMask="{x:Null}">
            <Label Content="Connection Status" Foreground="White" Height="30" Background="Red" HorizontalAlignment="Left"  FontSize="12"  Width="200" Name="labelInternetConnectionStatus" />
            <StackPanel Margin="0,100,0,0">
                <Button  Background="#FF3E3832" BorderBrush="{x:Null}" Click="RefreshMailBox_Click" Height="70" Cursor="Hand" Name="RefreshMailButton" Width="200">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="35" />
                            <RowDefinition Height="15" />
                            <RowDefinition Height="15" />
                        </Grid.RowDefinitions>

                        <StackPanel Grid.Row="0">
                            <TextBlock HorizontalAlignment="Center"  Height="30" Text="Refresh Mail Box" FontSize="20" Foreground="White" Width="154" />
                        </StackPanel>
                        <StackPanel Grid.Row="1" >
                            <ProgressBar Height="10" VerticalAlignment="Top" Name="progressBarRefresh" Width="190"/>
                        </StackPanel>
                        <StackPanel Grid.Row="2">
                            <TextBlock Name="textBloackAllMailCountProgress" Text="Pro" HorizontalAlignment="Center" Height="15"   FontSize="12" Foreground="White" TextWrapping="NoWrap" />
                        </StackPanel>
                    </Grid>
                </Button>
            </StackPanel>

            <StackPanel>
                <Button  Background="#FF3E3832" BorderBrush="{x:Null}" Click="NewMailButton_Click" Height="70"  Cursor="Hand" Name="NewMailButton" Width="200">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="35" />
                            <RowDefinition Height="15" />
                            <RowDefinition Height="15" />
                        </Grid.RowDefinitions>

                        <StackPanel Grid.Row="0" Orientation="Horizontal" Width="200">
                            <TextBlock Margin="30,0,0,0" Height="30" HorizontalAlignment="Right"  Text="New Emails" FontSize="20" Foreground="White"    />
                            <TextBlock  Name="TextBlockNewMailNotify" Text=" " Width="30" TextAlignment="Center"  Margin="10,0,0,0"  FontSize="20" Foreground="White" Background="Red"   />
                        </StackPanel>
                        <StackPanel Grid.Row="1">
                            <ProgressBar Height="10" Name="progressBarNewMail" Width="190" />
                        </StackPanel>
                        <StackPanel Grid.Row="2">
                            <TextBlock Name="textBloackNewMailCountProgress" Text="Pro" HorizontalAlignment="Center" Height="15"   FontSize="12" Foreground="White" TextWrapping="NoWrap" />
                        </StackPanel>
                    </Grid>
                </Button>
            </StackPanel>



            <StackPanel>
                <Button Background="#FF3E3832" BorderBrush="{x:Null}" Click="AllMailButton_Click" Height="50" Cursor="Hand"  Name="AllMailButton" Width="200">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="30" />
                            <RowDefinition Height="15" />
                        </Grid.RowDefinitions>

                        <StackPanel Grid.Row="0">
                            <TextBlock HorizontalAlignment="Center"  Text="All Emails" FontSize="20" Foreground="White" TextWrapping="NoWrap" />
                        </StackPanel>
                        <StackPanel Grid.Row="1">
                            <TextBlock Name="textBloackAllMailCount" Text="120" HorizontalAlignment="Center"    FontSize="12" Foreground="White" TextWrapping="NoWrap" />
                        </StackPanel>

                    </Grid>
                </Button>
            </StackPanel>



        </WrapPanel>


        <StackPanel Grid.Column="1" Width="300" Orientation="Vertical" Background="#FF797070" OpacityMask="{x:Null}">


            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="50" />
                    <RowDefinition Height="700" />
                </Grid.RowDefinitions>

                <StackPanel Grid.Row="0">
                    <TextBlock Text="View Emails By Project: " Foreground="White" FontSize="12"></TextBlock>
                    <toolkit:AutoCompleteBox Name="ProjectAutocompleteTextBox"  Width="300"  Margin="0, 0,0,0" Height="35"  ValueMemberPath="proj_reference"  FilterMode="Contains"  ItemsSource="{Binding}"  TabIndex="1" IsTabStop="True"  SelectionChanged="ReferenceTextBox_SelectionChanged" FontSize="18"   Opacity="1" HorizontalAlignment="Center" UseLayoutRounding="False" BorderBrush="WhiteSmoke" BorderThickness="2" Background="#FFB7BAA3">
                        <toolkit:AutoCompleteBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal"  >
                                    <TextBlock Text="{Binding Path=proj_reference}"/>
                                    <TextBlock Text=" - "/>
                                    <TextBlock Text="{Binding Path=proj_name}"/>
                                </StackPanel>
                            </DataTemplate>
                        </toolkit:AutoCompleteBox.ItemTemplate>
                    </toolkit:AutoCompleteBox>
                </StackPanel>


                <ListBox x:Name="listBoxNewEmails" Grid.Row="1" Width="300" Margin="0, 0,0,0" ScrollViewer.CanContentScroll="False" ScrollViewer.HorizontalScrollBarVisibility="Visible" ScrollViewer.VerticalScrollBarVisibility="Visible"   Style="{DynamicResource ListBoxStyle1}"    Background="DimGray"    SelectionChanged="listBoxAllEmails_SelectionChanged">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <WrapPanel Background="#FF3E3832" MaxWidth="300">
                                <StackPanel Orientation="Horizontal" MaxWidth="300">
                                    <!--<CheckBox IsChecked="{Binding Deleteable, Mode=TwoWay}" Name="CheckBoxActivity" VerticalAlignment="Center" HorizontalAlignment="Left"  />-->
                                    <WrapPanel Orientation="Vertical" MaxWidth="300">
                                        <StackPanel Height="35" Background="#FF3E3832">
                                            <Label Content="{Binding MessageSubject}" Height="35" Width="300" Foreground="White" Padding="10,0,0,0"   HorizontalAlignment="Left" FontSize="20" />
                                        </StackPanel>

                                        <StackPanel Height="20" Background="#FF342424" Margin="0,-2,0,0">
                                            <Label Content="{Binding MessageDate}" Height="20" Width="300" Foreground="White" Padding="10,0,0,0"    HorizontalAlignment="Left" FontSize="12" />
                                        </StackPanel>
                                    </WrapPanel>
                                </StackPanel>
                            </WrapPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>

                <ListBox x:Name="listBoxAllEmails" Grid.Row="1" Width="300" Margin="0, 0,0,0" ScrollViewer.CanContentScroll="False" ScrollViewer.HorizontalScrollBarVisibility="Visible" ScrollViewer.VerticalScrollBarVisibility="Visible"   Style="{DynamicResource ListBoxStyle1}"    Background="Aqua" SelectionChanged="listBoxAllEmails_SelectionChanged" >
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <WrapPanel Background="#FF3E3832" MaxWidth="300">
                                <StackPanel Orientation="Horizontal" MaxWidth="300">
                                    <!--<CheckBox IsChecked="{Binding Deleteable, Mode=TwoWay}" Name="CheckBoxActivity" VerticalAlignment="Center" HorizontalAlignment="Left"  />-->
                                    <WrapPanel Orientation="Vertical" MaxWidth="300">

                                        <StackPanel Height="35" Background="#FF3E3832">
                                            <Label Content="{Binding MessageSubject}" Height="35" Width="300" Foreground="White" Padding="10,0,0,0"   HorizontalAlignment="Left" FontSize="20" />
                                        </StackPanel>

                                        <StackPanel Height="20" Background="#FF342424" Margin="0,-2,0,0">
                                            <Label Content="{Binding MessageDate}" Height="20" Width="300" Foreground="White" Padding="10,0,0,0"    HorizontalAlignment="Left" FontSize="12" />
                                        </StackPanel>
                                    </WrapPanel>
                                </StackPanel>
                            </WrapPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>



            </Grid>





        </StackPanel>

        <WrapPanel Grid.Column="2" Orientation="Vertical" Grid.ColumnSpan="2">

            <Canvas x:Name="canvas"   Width="auto" Height="auto" RenderTransformOrigin="0.5,0.5">
                <Canvas.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform/>
                        <RotateTransform/>
                        <TranslateTransform/>
                    </TransformGroup>
                </Canvas.RenderTransform>

                <!--====== Controlers ========-->


                <Grid>
                    <WrapPanel Orientation="Vertical">
                        <WrapPanel Height="50" Width="860"  HorizontalAlignment="Left" Background="WhiteSmoke" Orientation="Horizontal">
                            <Label Content="Header : " Height="42" Name="labelMailHeader" FontSize="18" Width="680"/>
                            <StackPanel   Width="auto" Orientation="Horizontal" Margin=" 0,0,0,0">

                                <Grid Margin="140,0,0,0" HorizontalAlignment="Right" VerticalAlignment="Top">
                                    <Image Height="32" Margin="2" Source="/CECB;component/images/closeblack.png"  Width="32" MouseLeftButtonDown="Image_MouseLeftButtonDown" />
                                </Grid>
                            </StackPanel>
                        </WrapPanel>

                        <Expander Name="ExpanderComments" Header="Comments By :" Background="#FF797070" FontSize="18" Foreground="White">
                            <Grid Height="auto" Width="850">
                                <TextBox Height="500" Name="TextBoxBody" Text="" Padding="20,20,0,0"  Margin="0,0,0,0" FontSize="16" Cursor="IBeam"  >
                                    <TextBox.Background>
                                        <ImageBrush ImageSource="/CECB;component/images/notebookback1.jpg" Stretch="Fill" TileMode="None" />
                                    </TextBox.Background>
                                </TextBox>
                            </Grid>
                        </Expander>

                        <WrapPanel Height="auto" Width="860" Orientation="Vertical" Background="{x:Null}">

                            <StackPanel Orientation="Horizontal" Height="50" Background="#FF989796">
                                <Label Content="Attachments " Margin="0,-10,0,0" Height="45" Name="label2" FontSize="28" />
                                <Label Height="42" Margin="300,0,0,0" FontSize="16" Name="textBox1" Width="300" Foreground="White" BorderBrush="White" BorderThickness="3" />
                                <Image Height="49" Name="image1" Stretch="Fill" Width="66" Source="/CECB;component/images/attch.png" MouseLeftButtonUp="image1_MouseLeftButtonUp" />
                            </StackPanel>
                            <StackPanel  Orientation="Horizontal">
                                <Button Content="Preview" Height="50" Margin="590,0,0,0" Name="ConfrirmDetails"  Width="125" Click="ConfrirmDetails_Click" />
                                <Button Content="Confirm" Height="50" Margin="0,0,0,0" Name="FilerDetails"  Width="125" Click="FilerDetails_Click" />
                            </StackPanel>
                            <StackPanel Height="625">
                                <Canvas   >

                                    <ListBox x:Name="listBoxEmailValues" HorizontalAlignment="Left" ScrollViewer.CanContentScroll="False" ScrollViewer.VerticalScrollBarVisibility="Visible" ScrollViewer.HorizontalScrollBarVisibility="Hidden" SelectionChanged="listBoxActivities_SelectionChanged" Height="577" Background="DimGray" Width="853" BorderThickness="0">
                                        <ListBox.ItemTemplate>
                                            <DataTemplate>
                                                <WrapPanel  Margin="25,0,0,0" Orientation="Vertical" Background="#A83E3832" Width="750" Height="110">
                                                    <StackPanel Orientation="Vertical" Width="700">
                                                        <StackPanel Orientation="Horizontal">
                                                            <Label Content="Activity : " Height="30" Width="100" Foreground="White"    HorizontalAlignment="Left" FontSize="16" />
                                                            <Label Content="{Binding Actv_reference}" Height="30" Width="auto" Foreground="White"    HorizontalAlignment="Left" FontSize="16" />
                                                        </StackPanel>
                                                        <StackPanel Orientation="Horizontal">
                                                            <Label Content="Impact : " Height="30" Width="100" Foreground="White"    HorizontalAlignment="Left" FontSize="16" />
                                                            <Label Content="{Binding Impt_reference}" Height="30" Width="auto" Foreground="White"   HorizontalAlignment="Left" FontSize="16" />
                                                        </StackPanel>
                                                    </StackPanel>
                                                    <StackPanel Background="#FF989796" Width="700" Orientation="Horizontal" Margin="110,0,0,0">
                                                        <Label Content="Importence : " Height="35" Width="auto" Foreground="White"    HorizontalAlignment="Left" FontSize="15" />
                                                        <TextBox Text="{Binding Mtrx_magnitude}" Height="40" Margin="0,0,0,0" FontSize="18" Width="70" TextAlignment="Center" Foreground="Red"   HorizontalAlignment="Right"   />
                                                        <Label Content="Magnitude : " Height="35" Width="auto" Foreground="White"    HorizontalAlignment="Left" FontSize="15" />
                                                        <TextBox Text="{Binding Mtrx_importance}" Height="40" Margin="10,0,0,0" Width="70" FontSize="18" Foreground="Red"  TextAlignment="Center"  HorizontalAlignment="Right"   />
                                                        <Button Content="Confirm" Height="40" Name="ConfirmButton" Background="#FFB7BAA3" Margin="10,0,0,0" Width="100" Click="button1_Click" />
                                                    </StackPanel>
                                                </WrapPanel>
                                            </DataTemplate>
                                        </ListBox.ItemTemplate>
                                    </ListBox>


                                    <ListBox x:Name="SimpleMatrixlistBoxEmailValues" HorizontalAlignment="Left" ScrollViewer.CanContentScroll="False" ScrollViewer.VerticalScrollBarVisibility="Visible" ScrollViewer.HorizontalScrollBarVisibility="Hidden" SelectionChanged="listBoxActivities_SelectionChanged" Height="577" Background="DimGray" Width="853" BorderThickness="0">
                                        <ListBox.ItemTemplate>
                                            <DataTemplate>
                                                <WrapPanel  Margin="25,0,0,0" Orientation="Vertical" Background="#A83E3832" Width="750" Height="110">
                                                    <StackPanel Orientation="Vertical" Width="700">
                                                        <StackPanel Orientation="Horizontal">
                                                            <Label Content="Activity : " Height="30" Width="100" Foreground="White"    HorizontalAlignment="Left" FontSize="16" />
                                                            <Label Content="{Binding Actv_reference}" Height="30" Width="auto" Foreground="White"    HorizontalAlignment="Left" FontSize="16" />
                                                        </StackPanel>
                                                        <StackPanel Orientation="Horizontal">
                                                            <Label Content="Impact : " Height="30" Width="100" Foreground="White"    HorizontalAlignment="Left" FontSize="16" />
                                                            <Label Content="{Binding Impt_reference}" Height="30" Width="auto" Foreground="White"   HorizontalAlignment="Left" FontSize="16" />
                                                        </StackPanel>
                                                    </StackPanel>
                                                    <StackPanel Background="#FF989796" Width="700" Orientation="Horizontal" Margin="110,0,0,0">
                                                        <Label Content="Importence : " Height="35" Width="auto" Foreground="White"    HorizontalAlignment="Left" FontSize="15" />

                                                        <TextBox Text="{Binding Mtrx_value}" Height="40" Margin="10,0,0,0" Width="70" FontSize="18" Foreground="Red"  TextAlignment="Center"  HorizontalAlignment="Right"   />
                                                        <Button Content="Confirm" Height="40" Name="ConfirmButton" Background="#FFB7BAA3" Margin="10,0,0,0" Width="100" Click="ConfirmButton_Click" />
                                                    </StackPanel>
                                                </WrapPanel>
                                            </DataTemplate>
                                        </ListBox.ItemTemplate>
                                    </ListBox>


                                </Canvas>
                            </StackPanel>

                        </WrapPanel>
                    </WrapPanel>
                </Grid>



            </Canvas>

        </WrapPanel>
    </Grid>
</Window>
